// import { isTypedArray } from 'lodash'
import { handlerGetUrlParams } from '@/utils/dealUrlParams.js'
import request from '@/utils/request'

// const baseURL = process.env.VUE_APP_BASE_URL

// 新增交易公告
export function addInformationInfo(data) {
  return request({
    url: '/bus/information/add',
    method: 'POST',
    data
  })
}

// 查询交易公告信息
export function getInformationInfos(param) {
  const url = handlerGetUrlParams('/bus/information/list', param)
  return request({
    url,
    method: 'GET'
  })
}

export function checkInformationInfos(id) {
  // const url = handlerGetUrlParams('/bus/information', param)
  return request({
    url: `/bus/information/${id}`,
    method: 'GET'
  })
}

// 编辑公告
export function editInformationInfos(data) {
  return request({
    url: '/bus/information',
    method: 'PUT',
    data
  })
}

// 删除公告
export function deleteInformationInfos(ids) {
  return request({
    url: `/bus/information/${ids}`,
    method: 'DELETE'
  })
}
// 编辑的查询公告
// export function checkInformationInfos(ids) {
//   return request({
//     url: `/bus/information/`,
//     method: 'GET',
//     data: ids
//   })
// }

// 发布公告
export function issueInformationInfos(ids) {
  return request({
    url: `/bus/information/publish`,
    method: 'PUT',
    data: ids
  })
}

// 下架公告
export function dropInformationInfos(ids) {
  return request({
    url: `/bus/information/drop`,
    method: 'PUT',
    data: ids
  })
}